﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Mads.CoreDomain
{
  /// <summary>
  /// Represents a single car in the route.
  /// </summary>
  [DataContract]
  public class Car : KeyAbstraction
  {
    /// <summary>
    /// Car seatsNumber 
    /// </summary>
    [DataMember]
    public uint Number { get; private set; }

    /// <summary>
    /// Route that this car belongs to.
    /// </summary>
    public Route Route { get; private set; }

    /// <summary>
    /// Type of this car.
    /// </summary>
    [DataMember]
    public CarType CarType {get; set;}

    public Car(uint number, Route route, CarType carType)
    {
      if (route == null)
      {
        throw new ArgumentNullException("route");
      }
      if (carType == null)
      {
        throw new ArgumentNullException("carType");
      }

      Number = number;
      Route = route;
      CarType = carType;
    }
    public Car(uint id)
      : base(id)
    {
    }
  }
}